import request from "@/utils/request";
import { stringify } from "qs";
import { toFormData } from "@/utils/utils.jsx";

export default {
	//返审核订单预览
	reVertifyOrder(params) {
		return request(`/new-oms/order/returnAudit/batch`, {
			method: "post",
			data: params
		});
	},

	//作废订单预览
	voidOrder(params) {
		return request(`/new-oms/order/invalid/batch`, {
			method: "post",
			data: params
		});
	},

	//获取作废原因
	getInvalidReason() {
		return request(`/new-oms/order/getInvalidReason`);
	},

	//获取异常原因-可显示
	getErrorReason() {
		return request(`/new-common/errorConfig/list`);
	},

	//获取异常原因-所有
	getErrorReasonAll() {
		return request(`/new-common/errorConfig/listAllError`);
	},

	//批量修改异常
	batchUpdatErrorList(params) {
		return request(`/new-common/errorConfig/batchUpdate`, {
			method: "post",
			data: params
		});
	},

	//转正常订单预览
	normalOrder(params) {
		return request(`/new-oms/order/becomeNormal/batch`, {
			method: "post",
			data: params
		});
	},

	//智能合单预览
	autoMergeOrderView() {
		return request(`/new-oms-search/esOrder/batchMergeNum`);
	},

	//拆分订单策略列表
	spitStrategyList() {
		return request(`/new-common/splitStrategy/list`);
	},

	//拆分订单策略详情
	spitStrategyDetail(params) {
		return request(`/new-common/splitStrategy/getById?${stringify(params)}`);
	},

	//新增策略
	addSpitStrategy(params) {
		return request(`/new-common/splitStrategy/save`, {
			method: "post",
			data: params
		});
	},

	//编辑策略
	updateSpitStrategy(params) {
		return request(`/new-common/splitStrategy/update`, {
			method: "post",
			data: params
		});
	},

	//删除策略
	delSpitStrategy(params) {
		return request(`/new-common/splitStrategy/delete?${stringify(params)}`, {
			method: "post"
		});
	},

	//搜索供应商
	queryListByStoreName(params) {
		return request(`/blade-goods/zjfstore/listByStoreName?${stringify(params)}`);
	},

	//批量获取运单号
	getLogisticsNoOp(params) {
		return request(`/new-oms/order/getLogisticsNo`, {
			method: "POST",
			data: params
		});
	},

	//批量清空运单号
	clearLogisticsNoOp(params) {
		return request(`/new-oms-ec/order/remove/logisticsNo`, {
			method: "POST",
			data: params
		});
	},

	//复制订单
	copyOrderOp(params) {
		return request(`/new-oms/order/copyOrder?${stringify(params)}`);
	},

	//云仓订单 导入店铺列表
	getStoreListOp(params) {
		return request(`/blade-goods/ecstore/getStoresByChannel?${stringify(params)}`);
	},

	//云仓订单 导入添加店铺必传
	exportJingdongOrders(params) {
		return request(`/new-oms-ec/jdCloudOrder/import`, {
			method: "POST",
			body: toFormData(params)
		});
	},

	//批量打印并记录
	getPrintDataOp(params) {
		return request(`/new-oms-ec/printTask/batchPrint`, {
			method: "POST",
			data: params
		});
	},

	//打印成功
	printSuccessOp(params) {
		return request(`/new-oms-ec/printTask/printSuccess`, {
			method: "POST",
			data: params
		});
	},

	//设置打印机名称
	setPrinterNamesOp(params) {
		return request(`/new-oms-ec/printTask/setPrinterNames`, {
			method: "POST",
			data: params
		});
	},

	//根据物流单号和快递公司ID获取物流轨迹
	getOrderDynamic(params) {
		return request(`/blade-logistics/expressF3/trail?${stringify(params)}`);
	},

	//查询供应商匹配统计
	getInfoCount(params) {
		return request(`/new-oms-search/esOrder/query/supplier/info-count?${stringify(params)}`);
	},

	//智能快递重算
	appointStrategy(params) {
		return request(`/new-oms/order/appointStrategy`, {
			method: "POST",
			data: params
		});
	},

	//获取订单可用快递
	getOrderExpressTemplate(params) {
		return request(`/new-oms/order/getOrderExpressTemplate?${stringify(params)}`);
	},

	//查询标签模版筛选
	queryLabelTemplateList(params) {
		return request(`/new-common/labelTemplate/list`, {
			method: "POST",
			data: params
		});
	},

	//获取发货单打印数据
	queryInvoicePrintData(params) {
		return request(`/new-oms-search/getPrintData/getInvoicePrintData`, {
			method: "POST",
			data: params
		});
	},

	//字段管理
	queryFieldManageList(params) {
		return request(`/new-common/fieldManage/list?${stringify(params)}`);
	},

	//更新發貨單打印狀態
	updateShippingNotePrintState(params) {
		return request(`/new-oms/order/updateShippingNotePrintState`, {
			method: "POST",
			data: params
		});
	},

	// 更新打印模板
	updateKuaimaiOp(params) {
		return request(`/new-common/labelTemplate/update`, {
			method: "POST",
			data: params
		});
	},

	jdCloudOrderMatch(params) {
		return request(`/new-oms-ec/jdCloudOrder/orderMatch`, {
			method: "POST",
			data: params
		});
	},

	//获取店铺表格数据;
	getTableDataOp(params) {
		return request(`/blade-goods/newSystem/ecStore/newSystemEcStoreList`, {
			method: "post",
			data: params
		});
	}
};
//审核订单
// export async function getInventorytransactionRecordslist(params) {
// 	return request(`/new-wms/inventorytransactionrecords/list?${stringify(params)}`);
// },
